package com.cqndt.disaster.device.controller;

import com.cqndt.disaster.device.util.AjaxResult;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;
import com.cqndt.disaster.device.service.AppTabTwoRoundService;
import com.cqndt.disaster.device.service.AppTabPhotographyService;

/**
 * @author lgb
 * @date 2020-9-1
 * @return 项目实景图
 **/
@RestController
@RequestMapping(value="/api/v2")
public class ProjectPanoramaController extends BaseController{

    @Autowired
    private AppTabTwoRoundService tabTwoRoundService;
    @Autowired
    private AppTabPhotographyService tabPhotographyService;

    /**
     * @param type 倾斜摄影 - 1  720全景-2
     * @param projectId 项目id
     * @return 获取项目实景图
     **/
    @GetMapping(value="/panorama")
    public AjaxResult getProjectPanorama(Integer type,Integer projectId){
        if(type == 1){
            return entityResult(tabPhotographyService.selectByProjectId(projectId,"2"),"获取倾斜摄影");
        }else{
            return entityResult(tabTwoRoundService.selectByProjectId(projectId,"2"),"获取全景图");
        }
    }
}